package com.qf.pojo;

/**
 * 订单项实体
 */
public class OrderItem {
    /**
     *   `itemid` varchar(32) NOT NULL,
     *   `count` int(11) DEFAULT NULL,
     *   `subtotal` double DEFAULT NULL,
     *   `pid` varchar(32) DEFAULT NULL,
     *   `oid` varchar(32) DEFAULT NULL,
     */
    private String itemid; //订单项的编号
    private Integer count; //订单项包含的商品数量
    private Double subtotal; //小计金额
    private Product product; //包含哪个商品
    private Order order; //这个订单项属于哪个订单的

    public String getItemid() {
        return itemid;
    }

    public void setItemid(String itemid) {
        this.itemid = itemid;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Double getSubtotal() {
       // return subtotal;
        return this.count * product.getShop_price();
    }

    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }
}
